import request from '@/utils/request'

// 获取名片列表
export function getEnterpriseCardApplyList(query) {
  return request({
    url: '/card/enterpriseCardApply/paging',
    method: 'get',
    params: query
  })
}

// 更新名片状态
export function updateState(applyId, status) {
  if (!applyId) {
    return false
  }
  return request({
    url: '/card/enterpriseCardApply/updateState',
    method: 'post',
    params: { applyId: applyId,
      status: status
    }
  })
}

// 批量更新名片状态
export function batchUpdateStatus(data) {
  console.log('batchUpdateStatus')
  return request({
    url: '/card/enterpriseCardApply/batchUpdateStatus',
    method: 'post',
    data: data
  })
}

// 获取企业卡片数量
export function getEnterpriseCardNum(enterpriseId) {
  return request({
    url: '/card/enterpriseCardApply/getEnterpriseCardNum',
    method: 'post',
    params: { enterpriseId: enterpriseId }
  })
}

// 获取名片列表
export function pagingCardOrderList(query) {
  return request({
    url: '/card/enterpriseCardOrder/paging',
    method: 'get',
    params: query
  })
}
// 获取企业佣金
export function getEnterpriseCardOrderCommission(query) {
  return request({
    url: '/card/enterpriseCardOrder/getEnterpriseCardOrderCommission',
    method: 'get',
    params: query
  })
}

// 更改备注
export function changeRemark(data) {
  return request({
    url: '/card/enterpriseCardOrder/changeRemark',
    method: 'get',
    params: data
  })
}

// 获取卡片信息
export function getCardSetting(data) {
  return request({
    url: '/card/enterpriseCardApply/getCardSetting',
    method: 'get',
    params: data
  })
}

// 更改卡片设置
export function updateCardSetting(data) {
  return request({
    url: '/card/enterpriseCardApply/updateCardSetting',
    method: 'get',
    params: data
  })
}

// 分页查询门店名片申请
export function pagingStoreCardApply(data) {
  return request({
    url: '/card/enterpriseStoreCardApply/pagingStoreCardApply',
    method: 'get',
    params: data
  })
}

// 更新门店版本名片状态
export function updateStoreCardStatus(data) {
  return request({
    url: '/card/enterpriseStoreCardApply/updateStoreCardStatus',
    method: 'get',
    params: data
  })
}

// 获取门店版名片数量
export function getStoreCardNum(data) {
  return request({
    url: '/card/enterpriseStoreCardApply/getStoreCardNum',
    method: 'get',
    params: data
  })
}

// 修改备注
export function changeStoreApplyRemark(data) {
  return request({
    url: '/card/enterpriseStoreCardApply/changeStoreApplyRemark',
    method: 'get',
    params: data
  })
}
